	<script type="text/javascript" src="http://www.google.com/jsapi"></script>
	<script type="text/javascript">
	google.load("language", "1");
	</script>
	
	
	
	<div id="main">
	 <form class="query-box" onsubmit="return submitChange();">
		 <input class="query-input" id="source" type="text"
		 autocomplete="off" size="15" value="�Ť���ɶW�L�զ����C"/>
		 <input class="button" type="submit" value="Detect Language"/>
	 </form>
	</div>
	
	<div id="results">
		 <div id="results_title">Results:</div>
		 <hr/>
		 <div id="results_body"></div>
	</div>
	
	
	
	 <script type="text/javascript">
	 google.load("language", "1");
	 google.setOnLoadCallback(submitChange);
	 
	 
	 function submitChange()
	 {
		 var value = document.getElementById('source').value;
		 google.language.detect(value, detectResult);
		 return false;
	 }
	 
	 function detectResult(result)
	 {
		 var resultBody = document.getElementById("results_body");
		 if (result.language)
		 {
			 var language = 'unnamed';
			 for (l in google.language.Languages)
			 {
				 if (google.language.Languages[l] == result.language)
				 {
					 language = l;
					 break;
				 }
			 }
			 
			 var html = language +
			 (result.isReliable?' ( reliable':' ( not reliable') +
			 ' : ' + result.confidence + ')';
			 resultBody.innerHTML = html;
		 }
		 else
		 {
		 	resultBody.innerHTML = '<span style="color:red">Error Detecting</span>';
		 }
	 }
	 </script>
